'''CopyRight WangShiheng(C) 2021'''
import os

def read_json(text):
    cfg = eval(text)
    return cfg
def write_json():
    import pprint
    tool_name = input('ToolName:')
    cfg = {}
    cfg['dir'] = input('dir:')
    cfg['file_name'] = input('exe_name:')
    cfg['PythonVersion'] = '3.9.1'
    cfg['Version'] = input('exe_version:')
    cfg['CoreVersion'] = input('CoreVersion:')
    cfg['ProjectName'] = input('ProjectName:')
    cfg['file_path'] = os.path.join(cfg['dir'],cfg['file_name'])
    os.chdir(r'SourceCode\SourceCode')
    print(os.getcwd())
    with open(f'dist\cfg\{tool_name}.toolcfg','w') as f:
        f.write(pprint.pformat(cfg))


if __name__ == '__main__':
    write_json()
